<?php
class Marketing_Model_Ajax extends Zend_Db_Table{
	
	protected $_name 	= 'nam_marketing_item';
	protected $_primary ='id';
	protected $_ids;
	
	public function listItem($arrParam = null, $options = null){
		$db = Zend_Registry::get('connectDb');
		//$db = Zend_Db::factory($adapter, $config);
	
		if($options['task'] == 'admin-list'){
				
			$select = $db	->	select()
							->	from('nam_marketing_item AS mi', array('*', "DATE_FORMAT(mi.ngaybatdau,'%d/%m/%Y') AS ngaybatdau", "DATE_FORMAT(mi.ngayketthuc,'%d/%m/%Y') AS ngayketthuc"))
							->	limit(7,0);
	
			$result = $db	-> fetchAll($select);
		}
		return $result;
	}
}